package com.mynature.booking.model;


import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JButton;
import javax.swing.JLabel;
import java.awt.Color;
import org.eclipse.wb.swing.FocusTraversalOnArray;

import com.mynature.booking.database.CreateAccount;

import java.awt.Component;
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class LogAndCreate extends JFrame {

	private static final long serialVersionUID = 7369097370582252695L;
	public static LogAndCreate frame = new LogAndCreate();
	
	private JPanel contentPane;


	/**
	 * Create the frame.
	 */
	public LogAndCreate() {
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 450, 300);
		contentPane = new JPanel();
		contentPane.setForeground(Color.RED);
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(null);
		
		JButton btnLogIn = new JButton("Log in");
		btnLogIn.setBounds(42, 169, 142, 23);
		contentPane.add(btnLogIn);
		btnLogIn.addActionListener(new ActionListener() {
			
			
			public void actionPerformed(ActionEvent arg0) {

				setVisible(false);
				Login.frame.setVisible(true);
				
			}
		});
		
		
		JButton btnCreateAnAccount = new JButton("Create an account");
		btnCreateAnAccount.setBounds(224, 169, 142, 23);
		contentPane.add(btnCreateAnAccount);
		btnCreateAnAccount.addActionListener(new ActionListener() {
			
			@Override
			public void actionPerformed(ActionEvent e) {
			
				setVisible(false);
				CreateAccount.frame.setVisible(true);
				
			}
		});
		
		JLabel lblWelcomeToMy = new JLabel("Welcome to my nature booking system");
		lblWelcomeToMy.setFont(new Font("SimSun-ExtB", Font.PLAIN, 15));
		lblWelcomeToMy.setForeground(Color.RED);
		lblWelcomeToMy.setBounds(57, 93, 299, 34);
		contentPane.add(lblWelcomeToMy);
		contentPane.setFocusTraversalPolicy(new FocusTraversalOnArray(new Component[]{btnLogIn, btnCreateAnAccount, lblWelcomeToMy}));
	}
}
